<html>
  <head>
    <title>Algorithm.Diff.Diff</title>
    <style>
					a { text-decoration: none }
				
					.CollectionTitle { font-weight: bold }
					.PageTitle { font-size: 150%; font-weight: bold }

					.Summary { }
					.Signature { }					
					.Remarks { }
					.Members { }
					.Copyright { }
					
					.Section { font-size: 125%; font-weight: bold }
					.SectionBox { margin-left: 2em }
					.NamespaceName { display: block; font-size: 105%; font-weight: bold; color: #000066; border-bottom: 1px solid black }
					.NamespaceName:hover { font-style: italic }
					.NamespaceSumary { }
					.MemberName { font-size: 115%; font-weight: bold; margin-top: 1em }
					.MemberSignature { font-family: monospace; margin-top: 1em; }
					.MemberBox { }
					.Subsection { font-size: 105%; font-weight: bold }
					.SubsectionBox { margin-left: 2em; margin-bottom: 1em }
					
					.SignatureTable { background-color: #c0c0c0; }
					.EnumerationsTable th { background-color: #f2f2f2; }
					.CodeExampleTable { background-color: #f5f5dd; border: thin solid black; padding: .25em; }
					
					.MembersListing td { margin: 0px; border: 1px solid black; padding: .25em }
					
					.TypesListing td { margin: 0px;  padding: .25em }
					
					.titlebar {
						color: #efefef;
						font-size: 14pt;
						font-family: Trebuchet MS;
						border: 0;
						margin: 0;
						padding: 1em;
						background: #666666;
					}
					.titlebar a {
						color: #efefef;
					}
				</style>
  </head>
  <body style="margin: 0px;">
    <div class="titlebar">
      <div class="CollectionTitle">
        <a href="../index.html">Diff</a>
			:
			<a href="index.html">Algorithm.Diff Namespace</a></div>
      <div class="PageTitle">Diff</div>
    </div>
    <div style="padding: 1em">
      <p class="Summary">Computes the differences between two arbitrary lists.</p>
      <div class="Signature">
        <table class="SignatureTable" cellspacing="0" width="100%">
          <tr>
            <td>
              <table class="InnerSignatureTable" cellpadding="10" cellspacing="0" width="100%">
                <tr bgcolor="#f2f2f2">
                  <td>public class  <b>Diff</b> :
		
								<a href="../Algorithm.Diff/IDiff.html">IDiff</a></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
        <br>
        </br>
      </div>
      <div class="Remarks">
        <div class="Subsection">Remarks</div>
        <div class="SubsectionBox">
          <p>Use this class to compare two arbitrary lists of data.  Normally the lists will be of characters, to perform a character-level comparison, or of strings, to perform a line-by-line comparison, of two strings.</p>
          <p>Any object type may be contained in the lists, and comparisons among objects in the lists will be made with the System.Object.Equals method of the objects.  If the Equals method is overridden, the the System.Object.GetHashCode method must also be overridden so that any two objects considered equal always have the same hash code.</p>
          <p>A user-supplied <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IComparer">IComparer</a> and <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IHashCodeProvider">IHashCodeProvider</a> may be supplied to control how equality between elements in the list is determined.</p>
          <p>The differences between the lists are computed when the Diff object is constructed.  The differences themselves are represented as <a href="../Algorithm.Diff/Diff+Hunk.html">Algorithm.Diff.Diff+Hunk</a> objects.  To access the hunks, use a for-each over the Diff object.  Each hunk represents a range of corresponding elements in the two lists.</p>
          <table class="CodeExampleTable">
            <tr>
              <td>
                <b>
                  <font size="-1">C# Example</font>
                </b>
              </td>
            </tr>
            <tr>
              <td>
                <pre>using Algorithm.Diff;

// Performs a line-by-line, case-sensitive, whitespace-ignoring comparison.
diff = new Diff(file1.Split('\n'), file2.Split('\n'), true, false);

// Compares the contents of two ILists, using the objects' own Equals() methods
ArrayList list1 = ...;
ArrayList list2 = ...;
diff = new Diff(list1, list2)

// Compares the contents of two ILists, using custom comparison and hash code generation functions
diff = new Diff(list1, list2, comparer, hashcoder)

foreach (Diff.Hunk hunk in diff) {
	Console.WriteLine(hunk);
}
</pre>
              </td>
            </tr>
          </table>
        </div>
        <div class="Section">Members</div>
        <div class="SectionBox">
          <p>
						See Also: Inherited members from
						<a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Object">object</a>.
					</p>
          <div class="Subsection" style="margin-bottom: .75em">Constructors</div>
          <div class="SubsectionBox">
            <table Class="MembersListing">
              <tr valign="top">
                <td>
                  <div>
                    <b>
                      <a href="#member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm0m4m0m0m">Diff</a>
                    </b>(<a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IList">IList</a>, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IList">IList</a>, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IComparer">IComparer</a>, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IHashCodeProvider">IHashCodeProvider</a>)</div>Compares two lists using a user-supplied comparer and hash code provider.</td>
              </tr>
              <tr valign="top">
                <td>
                  <div>
                    <b>
                      <a href="#member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm1m4m0m0m">Diff</a>
                    </b>(<a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.String">string</a>, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.String">string</a>, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Boolean">bool</a>, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Boolean">bool</a>)</div>Performs a line-by-line comparison of two files.</td>
              </tr>
              <tr valign="top">
                <td>
                  <div>
                    <b>
                      <a href="#member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm2m4m0m0m">Diff</a>
                    </b>(<a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.String">string</a>[], <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.String">string</a>[], <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Boolean">bool</a>, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Boolean">bool</a>)</div>Compares two lists of strings, i.e. performs a line-by-line comparison of two documents.</td>
              </tr>
            </table>
          </div>
          <div class="Subsection" style="margin-bottom: .75em">Properties</div>
          <div class="SubsectionBox">
            <table Class="MembersListing">
              <tr valign="top">
                <td>
                  <b>
                    <a href="#member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm4m4m0m0m">Left</a>
                  </b>
					[read-only]
					<div></div></td>
                <td>
                  <i>
                    <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IList">IList</a>
                  </i>. The list used as the left document.</td>
              </tr>
              <tr valign="top">
                <td>
                  <b>
                    <a href="#member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm5m4m0m0m">Right</a>
                  </b>
					[read-only]
					<div></div></td>
                <td>
                  <i>
                    <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IList">IList</a>
                  </i>. The list used as the right document.</td>
              </tr>
            </table>
          </div>
          <div class="Subsection" style="margin-bottom: .75em">Methods</div>
          <div class="SubsectionBox">
            <table Class="MembersListing">
              <tr valign="top">
                <td>
                </td>
                <td>
                  <b>
                    <a href="#member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm3m4m0m0m">CreatePatch</a>
                  </b>()<nobr>
						:
						<a href="../Algorithm.Diff/Patch.html">Algorithm.Diff.Patch</a></nobr><div>Creates a <a href="../Algorithm.Diff/Patch.html">Algorithm.Diff.Patch</a> object for the diff.</div></td>
              </tr>
            </table>
          </div>
        </div>
      </div>
      <div class="Members">
        <div class="Section">Member Details</div>
        <div class="SectionBox">
          <a name="member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm0m4m0m0m">
          </a>
          <div class="MemberName">Diff Constructor
					</div>
          <div class="MemberSignature">public  <b>Diff</b> (<a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IList">IList</a> left, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IList">IList</a> right, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IComparer">IComparer</a> comparer, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IHashCodeProvider">IHashCodeProvider</a> hashcoder)</div>
          <div class="MemberBox">
            <p>Compares two lists using a user-supplied comparer and hash code provider.</p>
            <div class="Subsection">Parameters</div>
            <div class="SubsectionBox">
              <dl>
                <dt>
                  <i>left</i>
                </dt>
                <dd>The first list of objects.  The objects may be of any time, not just characters or strings.</dd>
                <dt>
                  <i>right</i>
                </dt>
                <dd>The second list of objects.  The objects may be of any time, not just characters or strings.To be added.</dd>
                <dt>
                  <i>comparer</i>
                </dt>
                <dd>Null to use the objects' own System.Object.Equals method to determine equality among objects in the lists, or a <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IComparer">IComparer</a> object to use to perform equality tests.</dd>
                <dt>
                  <i>hashcoder</i>
                </dt>
                <dd>Null to use the objects' own System.Object.GetHashCode method to determine hash codes for the objects in the lists, or a <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IHashCodeProvider">IHashCodeProvider</a> object to use to provide the hash codes.</dd>
              </dl>
            </div>
            <div class="Subsection">Remarks</div>
            <div class="SubsectionBox">
              <p>The Diff object will be initialized as the comparison between the two lists, using the comparison and hash code provider objects if supplied.</p>
              <p>Both the comparison and hash code provider objects are optional, and if one is provided it is not strictly necessary to provide the other.  However, it must be the case that when two objects are considered equal (either by their own Equals method or by the user-given comparer), then they must have the same hash code.  It is generally the case that when a comparer object is provided, a hash code provider must be given as well.</p>
              <p>Comparer objects are supposed to return -1, 0, or 1 depending on whether the first object is "less" than the second, equal, or greater.  The Diff class is not concerned with the ordering of objects, so a comparer used here can return either 1 or -1 when the two objects being compared are not equal.</p>
            </div>
            <hr size="1">
            </hr>
          </div>
          <a name="member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm1m4m0m0m">
          </a>
          <div class="MemberName">Diff Constructor
					</div>
          <div class="MemberSignature">public  <b>Diff</b> (<a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.String">string</a> leftFile, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.String">string</a> rightFile, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Boolean">bool</a> caseSensitive, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Boolean">bool</a> compareWhitespace)</div>
          <div class="MemberBox">
            <p>Performs a line-by-line comparison of two files.</p>
            <div class="Subsection">Parameters</div>
            <div class="SubsectionBox">
              <dl>
                <dt>
                  <i>leftFile</i>
                </dt>
                <dd>The path to the left file.</dd>
                <dt>
                  <i>rightFile</i>
                </dt>
                <dd>The path to the right file.</dd>
                <dt>
                  <i>caseSensitive</i>
                </dt>
                <dd>Whether to treat changes in case as differences.</dd>
                <dt>
                  <i>compareWhitespace</i>
                </dt>
                <dd>Whether to treat changes in whitespace as differences.</dd>
              </dl>
            </div>
            <div class="Subsection">Remarks</div>
            <div class="SubsectionBox">The Diff object is initialized as a comparison between the two documents.  Comparisons are made using the current culture settings.</div>
            <hr size="1">
            </hr>
          </div>
          <a name="member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm2m4m0m0m">
          </a>
          <div class="MemberName">Diff Constructor
					</div>
          <div class="MemberSignature">public  <b>Diff</b> (<a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.String">string</a>[] left, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.String">string</a>[] right, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Boolean">bool</a> caseSensitive, <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Boolean">bool</a> compareWhitespace)</div>
          <div class="MemberBox">
            <p>Compares two lists of strings, i.e. performs a line-by-line comparison of two documents.</p>
            <div class="Subsection">Parameters</div>
            <div class="SubsectionBox">
              <dl>
                <dt>
                  <i>left</i>
                </dt>
                <dd>The lines of the first document.</dd>
                <dt>
                  <i>right</i>
                </dt>
                <dd>The lines of the second document.</dd>
                <dt>
                  <i>caseSensitive</i>
                </dt>
                <dd>Whether to perform a case-sensitive comparison.</dd>
                <dt>
                  <i>compareWhitespace</i>
                </dt>
                <dd>Whether to compare changes in whitespace.</dd>
              </dl>
            </div>
            <div class="Subsection">Remarks</div>
            <div class="SubsectionBox">The Diff object is initialized as a comparison between the two documents.  Comparisons are made using the current culture settings.</div>
            <hr size="1">
            </hr>
          </div>
          <a name="member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm3m4m0m0m">
          </a>
          <div class="MemberName">CreatePatch</div>
          <div class="MemberSignature">public <a href="../Algorithm.Diff/Patch.html">Patch</a> <b>CreatePatch</b> ()</div>
          <div class="MemberBox">
            <p>Creates a <a href="../Algorithm.Diff/Patch.html">Algorithm.Diff.Patch</a> object for the diff.</p>
            <div class="Subsection">Returns</div>
            <div class="SubsectionBox">A patch object for the diff.</div>
            <div class="Subsection">Remarks</div>
            <div class="SubsectionBox">A Patch can generate more compact representations of diffs.</div>
            <hr size="1">
            </hr>
          </div>
          <a name="member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm4m4m0m0m">
          </a>
          <div class="MemberName">Left</div>
          <div class="MemberSignature">public <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IList">IList</a> <b>Left</b>  
						{
						 get; 
						}
					</div>
          <div class="MemberBox">
            <p>The list used as the left document.</p>
            <div class="Subsection">Value</div>
            <div class="SubsectionBox">The left document.</div>
            <div class="Subsection">Remarks</div>
            <div class="SubsectionBox">None.</div>
            <hr size="1">
            </hr>
          </div>
          <a name="member_Monofilemx003Ammx002Fmmx002Fmmx002Fmhomemx002Fmtauberermx002Fmdevmx002Fmdiffmx002Fmdocmx002FmAlgorithm.Diffmx002FmDiff.xmlElementm5m4m0m0m">
          </a>
          <div class="MemberName">Right</div>
          <div class="MemberSignature">public <a href="&#xA;						http://mono.ximian.com:8080/monodoc.ashx?link=T:System.Collections.IList">IList</a> <b>Right</b>  
						{
						 get; 
						}
					</div>
          <div class="MemberBox">
            <p>The list used as the right document.</p>
            <div class="Subsection">Value</div>
            <div class="SubsectionBox">The right document.</div>
            <div class="Subsection">Remarks</div>
            <div class="SubsectionBox">None.</div>
            <hr size="1">
            </hr>
          </div>
        </div>
      </div>
      <hr size="1" />
      <div class="Copyright">
      </div>
    </div>
  </body>
</html>